from Katana import NodegraphAPI, DrawingModule, Utils, PyXmlIO as XIO, UniqueName

class dsMtlX_ResolveNode(NodegraphAPI.SuperTool):

    def __init__(self):
        self.hideNodegraphGroupControls()
        self.getParameters().parseXML('''
        \n\t\t\t\t
        <group_parameter>\n\t\t\t\t
        <string_parameter name='location' value='/root/world/geo'/>\n\t\t\t\t
        <string_parameter name='matLocation' value='matlx_in'/>\n\t\t\t\t
        <string_parameter name='mtlXAsset' value=''/>\n\t\t\t\t
        <string_parameter name='mode' value=''/>\n\t\t\t\t
        </group_parameter>''')

        self.addInputPort('in')
        self.addOutputPort('out')

    def upgrade(self, force = False):
        print 'upgrade() has been called.'

    def addParameterHints(self, attrName, inputDict):
        """
        This function will be called by Katana to allow you to provide hints
        to the UI to change how parameters are displayed.
        """
        inputDict.update(_ExtraHints.get(attrName, {}))


_ExtraHints = {'dsMtlX_ResolveNode.location': {'widget': 'newScenegraphLocation'},
 'dsMtlX_ResolveNode.mtlXAsset': {'widget': 'assetIdInput',
                                  'help': '\n\t\t\tSelect MtlXS XML file .\n\t\t\t',
                                  'fileTypes': 'xml'}}
